// src/utils/rem-utils.js
let isRemEnabled = false
const baseSize = 16 // 基准大小
function setRem() {
    const scale = document.documentElement.clientWidth / 1920
    document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
    console.log(document.documentElement.style.fontSize, "rem");
}
export function enableRem() {
    if (isRemEnabled) return

    setRem()
    window.addEventListener('resize', setRem)
    isRemEnabled = true
}

export function disableRem() {
    document.documentElement.style.fontSize = ''
    window.removeEventListener('resize', setRem)
    isRemEnabled = false
}